//
//  UIButton+Extension.swift
//  jackWu
//
//  Created by Lewhaming on 2016/11/21.
//  Copyright © 2016年 IQ. All rights reserved.
//

import UIKit


extension UIButton
{
    //便利构造方法
    convenience init(imageName: String, backgroudImageName: String){
        self.init()
        //先调用
        setImage(UIImage(named:imageName), for: UIControlState.normal)
        setImage(UIImage(named:imageName + "_highlighted"), for: UIControlState.highlighted)
        
        setBackgroundImage(UIImage(named:backgroudImageName), for: UIControlState.normal)
        setBackgroundImage(UIImage(named:backgroudImageName + "_highlighted"), for: UIControlState.highlighted)
        
        sizeToFit()
    }
    
}
